3.2.36 \(\int x^2 \tan (a+i \log (x)) \, dx\) [136]

3.2.36.1 Optimal result
3.2.36.2 Mathematica [A] (verified)
3.2.36.3 Rubi [A] (verified)
3.2.36.4 Maple [A] (verified)
3.2.36.5 Fricas [A] (verification not implemented)
3.2.36.6 Sympy [A] (verification not implemented)
3.2.36.7 Maxima [B] (verification not implemented)
3.2.36.8 Giac [A] (verification not implemented)
3.2.36.9 Mupad [B] (verification not implemented)

3.2.36.1 Optimal result

Integrand size = 13, antiderivative size = 43 \[ \int x^2 \tan (a+i \log (x)) \, dx=-2 i e^{2 i a} x+\frac {i x^3}{3}+2 i e^{3 i a} \arctan \left (e^{-i a} x\right ) \]

output
-2*I*exp(2*I*a)*x+1/3*I*x^3+2*I*exp(3*I*a)*arctan(x/exp(I*a))
 
3.2.36.2 Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.53 \[ \int x^2 \tan (a+i \log (x)) \, dx=\frac {i x^3}{3}-2 i x \cos (2 a)+2 i \arctan (x \cos (a)-i x \sin (a)) \cos (3 a)+2 x \sin (2 a)-2 \arctan (x \cos (a)-i x \sin (a)) \sin (3 a) \]

input
Integrate[x^2*Tan[a + I*Log[x]],x]
 
output
(I/3)*x^3 - (2*I)*x*Cos[2*a] + (2*I)*ArcTan[x*Cos[a] - I*x*Sin[a]]*Cos[3*a 
] + 2*x*Sin[2*a] - 2*ArcTan[x*Cos[a] - I*x*Sin[a]]*Sin[3*a]
 
3.2.36.3 Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.98, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {5006, 947, 363, 262, 216}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int x^2 \tan (a+i \log (x)) \, dx\)

\(\Big \downarrow \) 5006

\(\displaystyle \int \frac {x^2 \left (i-\frac {i e^{2 i a}}{x^2}\right )}{1+\frac {e^{2 i a}}{x^2}}dx\)

\(\Big \downarrow \) 947

\(\displaystyle \int \frac {x^2 \left (i x^2-i e^{2 i a}\right )}{x^2+e^{2 i a}}dx\)

\(\Big \downarrow \) 363

\(\displaystyle \frac {i x^3}{3}-2 i e^{2 i a} \int \frac {x^2}{x^2+e^{2 i a}}dx\)

\(\Big \downarrow \) 262

\(\displaystyle \frac {i x^3}{3}-2 i e^{2 i a} \left (x-e^{2 i a} \int \frac {1}{x^2+e^{2 i a}}dx\right )\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {i x^3}{3}-2 i e^{2 i a} \left (x-e^{i a} \arctan \left (e^{-i a} x\right )\right )\)

input
Int[x^2*Tan[a + I*Log[x]],x]
 
output
(I/3)*x^3 - (2*I)*E^((2*I)*a)*(x - E^(I*a)*ArcTan[x/E^(I*a)])
 

3.2.36.3.1 Defintions of rubi rules used

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 262
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x) 
^(m - 1)*((a + b*x^2)^(p + 1)/(b*(m + 2*p + 1))), x] - Simp[a*c^2*((m - 1)/ 
(b*(m + 2*p + 1)))   Int[(c*x)^(m - 2)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b 
, c, p}, x] && GtQ[m, 2 - 1] && NeQ[m + 2*p + 1, 0] && IntBinomialQ[a, b, c 
, 2, m, p, x]
 

rule 363
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2), x 
_Symbol] :> Simp[d*(e*x)^(m + 1)*((a + b*x^2)^(p + 1)/(b*e*(m + 2*p + 3))), 
 x] - Simp[(a*d*(m + 1) - b*c*(m + 2*p + 3))/(b*(m + 2*p + 3))   Int[(e*x)^ 
m*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && NeQ[b*c - a*d 
, 0] && NeQ[m + 2*p + 3, 0]
 

rule 947
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_. 
), x_Symbol] :> Int[x^(m + n*(p + q))*(b + a/x^n)^p*(d + c/x^n)^q, x] /; Fr 
eeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && IntegersQ[p, q] && NegQ[ 
n]
 

rule 5006
Int[((e_.)*(x_))^(m_.)*Tan[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.), x_Symbol] 
:> Int[(e*x)^m*((I - I*E^(2*I*a*d)*x^(2*I*b*d))/(1 + E^(2*I*a*d)*x^(2*I*b*d 
)))^p, x] /; FreeQ[{a, b, d, e, m, p}, x]
 
3.2.36.4 Maple [A] (verified)

Time = 3.04 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.77

method result size
risch \(\frac {i x^{3}}{3}-2 i {\mathrm e}^{2 i a} x +2 i \arctan \left (x \,{\mathrm e}^{-i a}\right ) {\mathrm e}^{3 i a}\) \(33\)

input
int(x^2*tan(a+I*ln(x)),x,method=_RETURNVERBOSE)
 
output
1/3*I*x^3-2*I*exp(2*I*a)*x+2*I*arctan(x*exp(-I*a))*exp(3*I*a)
 
3.2.36.5 Fricas [A] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.98 \[ \int x^2 \tan (a+i \log (x)) \, dx=\frac {1}{3} i \, x^{3} - 2 i \, x e^{\left (2 i \, a\right )} - e^{\left (3 i \, a\right )} \log \left (x + i \, e^{\left (i \, a\right )}\right ) + e^{\left (3 i \, a\right )} \log \left (x - i \, e^{\left (i \, a\right )}\right ) \]

input
integrate(x^2*tan(a+I*log(x)),x, algorithm="fricas")
 
output
1/3*I*x^3 - 2*I*x*e^(2*I*a) - e^(3*I*a)*log(x + I*e^(I*a)) + e^(3*I*a)*log 
(x - I*e^(I*a))
 
3.2.36.6 Sympy [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.42 \[ \int x^2 \tan (a+i \log (x)) \, dx=\frac {i x^{3}}{3} - 2 i x e^{2 i a} + \left (\log {\left (x e^{2 i a} - i e^{3 i a} \right )} - \log {\left (x e^{2 i a} + i e^{3 i a} \right )}\right ) e^{3 i a} \]

input
integrate(x**2*tan(a+I*ln(x)),x)
 
output
I*x**3/3 - 2*I*x*exp(2*I*a) + (log(x*exp(2*I*a) - I*exp(3*I*a)) - log(x*ex 
p(2*I*a) + I*exp(3*I*a)))*exp(3*I*a)
 
3.2.36.7 Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 149 vs. \(2 (26) = 52\).

Time = 0.30 (sec) , antiderivative size = 149, normalized size of antiderivative = 3.47 \[ \int x^2 \tan (a+i \log (x)) \, dx=\frac {1}{3} i \, x^{3} - 2 \, x {\left (i \, \cos \left (2 \, a\right ) - \sin \left (2 \, a\right )\right )} - {\left (i \, \cos \left (3 \, a\right ) - \sin \left (3 \, a\right )\right )} \arctan \left (\frac {2 \, x \cos \left (a\right )}{x^{2} + \cos \left (a\right )^{2} - 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}, \frac {x^{2} - \cos \left (a\right )^{2} - \sin \left (a\right )^{2}}{x^{2} + \cos \left (a\right )^{2} - 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}\right ) + \frac {1}{2} \, {\left (\cos \left (3 \, a\right ) + i \, \sin \left (3 \, a\right )\right )} \log \left (\frac {x^{2} + \cos \left (a\right )^{2} + 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}{x^{2} + \cos \left (a\right )^{2} - 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}\right ) \]

input
integrate(x^2*tan(a+I*log(x)),x, algorithm="maxima")
 
output
1/3*I*x^3 - 2*x*(I*cos(2*a) - sin(2*a)) - (I*cos(3*a) - sin(3*a))*arctan2( 
2*x*cos(a)/(x^2 + cos(a)^2 - 2*x*sin(a) + sin(a)^2), (x^2 - cos(a)^2 - sin 
(a)^2)/(x^2 + cos(a)^2 - 2*x*sin(a) + sin(a)^2)) + 1/2*(cos(3*a) + I*sin(3 
*a))*log((x^2 + cos(a)^2 + 2*x*sin(a) + sin(a)^2)/(x^2 + cos(a)^2 - 2*x*si 
n(a) + sin(a)^2))
 
3.2.36.8 Giac [A] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.60 \[ \int x^2 \tan (a+i \log (x)) \, dx=\frac {1}{3} i \, x^{3} + 2 i \, \arctan \left (x e^{\left (-i \, a\right )}\right ) e^{\left (3 i \, a\right )} - 2 i \, x e^{\left (2 i \, a\right )} \]

input
integrate(x^2*tan(a+I*log(x)),x, algorithm="giac")
 
output
1/3*I*x^3 + 2*I*arctan(x*e^(-I*a))*e^(3*I*a) - 2*I*x*e^(2*I*a)
 
3.2.36.9 Mupad [B] (verification not implemented)

Time = 26.15 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.84 \[ \int x^2 \tan (a+i \log (x)) \, dx={\left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\right )}^{3/2}\,\mathrm {atan}\left (\frac {x}{\sqrt {{\mathrm {e}}^{a\,2{}\mathrm {i}}}}\right )\,2{}\mathrm {i}+\frac {x^3\,1{}\mathrm {i}}{3}-x\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,2{}\mathrm {i} \]

input
int(x^2*tan(a + log(x)*1i),x)
 
output
exp(a*2i)^(3/2)*atan(x/exp(a*2i)^(1/2))*2i + (x^3*1i)/3 - x*exp(a*2i)*2i